{extend name="layout/layout" /}

{block name="pagecss"}
<style>
    .navigations img {
        cursor: pointer;
    }
</style>
{/block}

{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 社区设置</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        非村民是否允许评论
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="pinglunoff" value="0" placeholder="" {if condition="$config == '' || $config['pinglunoff'] == 0"}checked=""{/if}>
                                                否
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="pinglunoff" value="1" placeholder="" {if condition="$config != '' && $config['pinglunoff'] == 1"}checked=""{/if}>
                                                是
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        非村民是否允许发布动态
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="dongtaioff" value="0" placeholder="" {if condition="$config == '' || $config['dongtaioff'] == 0"}checked=""{/if}>
                                                否
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="dongtaioff" value="1" placeholder="" {if condition="$config != '' && $config['dongtaioff'] == 1"}checked=""{/if}>
                                                是
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        发布动态是否需要审核
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="dongtaicheckoff" value="0" placeholder="" {if condition="$config == '' || $config['dongtaicheckoff'] == 0"}checked="checked"{/if} >
                                                否
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="dongtaicheckoff" value="1" placeholder="" {if condition="$config && $config['dongtaicheckoff'] == 1"}checked="checked"{/if} >
                                                是
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        村社区导航显示
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline navigations">
                                            {if condition="!$nav"}
                                            {volist name="navigation" id="vo"}
                                            <div id="upload-image{$vo.id}" style="position: relative;float: left;margin-left: 40px">
                                            <span id="upload-btn{$vo.id}" data-multi="false">
                                                <input type="hidden" class="form-control" id="coverImg"  name="imgurl{$vo.id}" value="">
                                                <img src="{if condition="$vo.imgurl != ''"}{$vo.imgurl}{else/}__STATIC__/admin/img/default.png{/if}" alt="图片上传" style="width: 80px;height: 80px;display: block;" />
                                            </span>
                                                <label class="mt-checkbox mt-checkbox-outline" style="margin-top: 10px;">
                                                    <input type="checkbox" class="" name="villnavigation" value="{$vo.id}" placeholder="" >
                                                    {$vo.name}
                                                    <span></span>
                                                </label>
                                            </div>
                                            {/volist}
                                            {else/}
                                            {volist name="nav" id="vo"}
                                            <div id="upload-image{$vo.typeId}" style="position: relative;float: left;margin-left: 40px">
                                            <span id="upload-btn{$vo.typeId}" data-multi="false">
                                                <input type="hidden" class="form-control" id="coverImg"  name="imgurl{$vo.typeId}" value="">
                                                <img src="{if condition="$vo.imgurl != ''"}{$vo.imgurl}{else/}__STATIC__/admin/img/default.png{/if}" alt="图片上传" style="width: 80px;height: 80px;display: block;" />
                                            </span>
                                                <label class="mt-checkbox mt-checkbox-outline" style="margin-top: 10px;">
                                                    <input type="checkbox" class="" name="villnavigation" value="{$vo.typeId}" placeholder="" {if condition="$vo.status == 1"}checked="checked"{/if}>
                                                    {$vo.name}
                                                    <span></span>
                                                </label>
                                            </div>
                                            {/volist}
                                            {/if}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        前台贫困户查阅权限
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="none_add_member" name="isshowpinkun" value="1" placeholder="" {if condition="$config == '' || $config['isshowpinkun'] == 1"}checked="checked"{/if} >
                                                所有人公开
                                                <span></span>
                                            </label>

                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="show_add_member" name="isshowpinkun" value="2" placeholder="" {if condition="$config && $config['isshowpinkun'] == 2"}checked="checked"{/if} >
                                                部分人员公开
                                                <span></span>
                                            </label>

                                            <div class="main_add_member" {if condition="$config=='' || $config['isshowpinkun'] == 1"}style="display:none;"{/if}>
                                                <button type="button" class="btn btn-success addMember-btn" style="margin-top: 10px;">
                                                    <i class="fa fa-plus"></i> 添加人员
                                                </button>
                                                <div class="portlet light" style="padding: 0">
                                                    <div class="portlet-body">
                                                        <form action="" class="form-horizontal" name="ajaxForm">
                                                            <div class="">
                                                                <table id="joinmeeting-datatable" class="table table-bordered table-hover dataTable">
                                                                    <thead>
                                                                    <th>头像</th>
                                                                    <th>姓名</th>
                                                                    <th>职务</th>
                                                                    <th>操作</th>
                                                                    </thead>
                                                                </table>
                                                            </div>
                                                            <input type="hidden" class="isshowpinkun" value="{if condition="isset($config['isshowpinkun'])"}{$config['isshowpinkun']}{else/}1{/if}">

                                                        </form>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" class="memberIds" value="" >
                        <input type="hidden" class="townId" name="townId" value="{$townId}" />
                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 详情 模态框 -->
<div class="modal fade" id="view-modal" data-backdrop="static" data-keyboard="false" >
    <div class="modal-dialog" style="width:800px; height: 520px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">x</button>
                <h4 class="modal-title">村民</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="portlet light" style="margin-bottom: 0;">
                            <div class="box-header">
                                <div class="row">
                                    {include file="common:townconfig" /}
                                </div>
                            </div>
                            <div class="portlet-body">
                                <form id="joinmeeting-form" action="" class="form-horizontal" name="ajaxForm">
                                    <div class="">
                                        <table id="member-datatable" class="table table-bordered table-hover dataTable">
                                            <thead>
                                            <th>头像</th>
                                            <th>姓名</th>
                                            <th>职务</th>
                                            <th>操作</th>
                                            </thead>
                                        </table>
                                    </div>

                                    <!--<button type="button" class="btn btn-circle btn-primary sellectall-btn" data-value="1"> 全选 </button>-->
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn blue saveJoinmember-btn"> 确定 </button>
                <button type="button" class="btn default" data-dismiss="modal"> 关闭 </button>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="joinshowpinkunAdd_url" value="{:url('admin/townconfig/addjoinmember')}">
<input type="hidden" class="joinmeetingDatalist_url" value="{:url('admin/townconfig/joinmeetinglist')}">
<input type="hidden" class="joinDelete_url" value="{:url('admin/townconfig/delmember')}">
<input type="hidden" class="memberDatalist_url" value="{:url('admin/townconfig/memberlist')}">

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
{/block}

{block name="pagescript"}
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/configpost')}";
</script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/custom.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/uploadimg01.js?v={:time()}" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/townconfig.js?v={:time()}" type="text/javascript"></script>
{/block}